package unittest;

/**
 * 接受一个数并返回该数各位的和
 */
public class SumDigits {
    public int sum(int num) {
        int sum = 0;
        while (num > 0) {
            sum = sum + num % 10;
            num = num / 10;
        }
        return sum;
    }
}
